#ifndef HASIO_BASIC_SOCKET_HPP
#define HASIO_BASIC_SOCKET_HPP

#if defined(_MSC_VER) && (_MSC_VER >= 1200)
# pragma once
#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)

#include "detail/reactive_socket_service.hpp"
#include "detail/io_object_impl.hpp"

namespace hasio {

template<typename Protocol>
class basic_socket
    //: public socket_base
{
public:
    using protocol_type = Protocol;
    using handle_type = typename detail::reactive_socket_service<Protocol>::handle_type;

public:
    void open(const protocol_type &protocol = protocol_type())
    {
        hasio::error_code ec;
        impl_.get_service().open(protocol, ec);
    }

protected:
    detail::io_object_impl<detail::reactive_socket_service<Protocol>> impl_;
};

}

#endif // HASIO_BASIC_SOCKET_HPP 